<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/13
 * Time: 14:37
 */
include "config.php";
if(isset($_REQUEST["u_id"])){
    $UID=$_REQUEST["u_id"];
    $sql="SELECT * FROM cart WHERE u_id=?";
    $stmt = $conn->prepare($sql);
    $stmt->bind_param("i", $UID);
    $stmt->execute();
    $listArr = array();
    $result = $stmt->get_result();
    while($row = $result->fetch_assoc()){
        array_push($listArr, $row);}
    print_r(json_encode($listArr));
}